home *** CD-ROM | disk | FTP | other *** search
/ Aminet 48 / Aminet 48 (2002)(GTI - Schatztruhe)[!][Apr 2002].iso / Aminet / util / moni / Scout-src.lha / netinclude / netinet / ip_var.h < prev    next >
Encoding:
C/C++ Source or Header  |  2002-02-13  |  3.1 KB  |  102 lines

  1. #ifndef NETINET_IP_VAR_H
  2. #define NETINET_IP_VAR_H \
  3.        "$Id: ip_var.h,v 1.1.1.1 2001/11/26 22:21:17 tboeckel Exp $"
  4. /*
  5.  *      IP statistics
  6.  *
  7.  *      Copyright © 1994 AmiTCP/IP Group,
  8.  *                       Network Solutions Development, Inc.
  9.  *                       All rights reserved.
  10.  */
  11.  
  12. /*
  13.  * Overlay for ip header used by other protocols (tcp, udp).
  14.  */
  15. struct ipovly {
  16.     caddr_t    ih_next, ih_prev;    /* for protocol sequence q's */
  17.     u_char    ih_x1;            /* (unused) */
  18.     u_char    ih_pr;            /* protocol */
  19.     short    ih_len;            /* protocol length */
  20.     struct    in_addr ih_src;        /* source internet address */
  21.     struct    in_addr ih_dst;        /* destination internet address */
  22. };
  23.  
  24. /*
  25.  * Ip reassembly queue structure.  Each fragment
  26.  * being reassembled is attached to one of these structures.
  27.  * They are timed out after ipq_ttl drops to 0, and may also
  28.  * be reclaimed if memory becomes tight.
  29.  */
  30. struct ipq {
  31.     struct    ipq *next,*prev;    /* to other reass headers */
  32.     u_char    ipq_ttl;        /* time for reass q to live */
  33.     u_char    ipq_p;            /* protocol of this fragment */
  34.     u_short    ipq_id;            /* sequence id for reassembly */
  35.     struct    ipasfrag *ipq_next,*ipq_prev;
  36.                     /* to ip headers of fragments */
  37.     struct    in_addr ipq_src,ipq_dst;
  38. };
  39.  
  40. /*
  41.  * Ip header, when holding a fragment.
  42.  *
  43.  * Note: ipf_next must be at same offset as ipq_next above
  44.  */
  45. struct    ipasfrag {
  46. #if BYTE_ORDER == LITTLE_ENDIAN 
  47.     u_char    ip_hl:4;
  48.     u_char    ip_v:4;
  49. #endif
  50. #if BYTE_ORDER == BIG_ENDIAN 
  51.     u_char    ip_v:4;
  52.     u_char    ip_hl:4;
  53. #endif
  54.     u_char    ipf_mff;        /* copied from (ip_off&IP_MF) */
  55.     short    ip_len;
  56.     u_short    ip_id;
  57.     short    ip_off;
  58.     u_char    ip_ttl;
  59.     u_char    ip_p;
  60.     u_short    ip_sum;
  61.     struct    ipasfrag *ipf_next;    /* next fragment */
  62.     struct    ipasfrag *ipf_prev;    /* previous fragment */
  63. };
  64.  
  65. /*
  66.  * Structure stored in mbuf in inpcb.ip_options
  67.  * and passed to ip_output when ip options are in use.
  68.  * The actual length of the options (including ipopt_dst)
  69.  * is in m_len.
  70.  */
  71. #define MAX_IPOPTLEN    40
  72.  
  73. struct ipoption {
  74.     struct    in_addr ipopt_dst;    /* first-hop dst if source routed */
  75.     char    ipopt_list[MAX_IPOPTLEN];    /* options proper */
  76. };
  77.  
  78. struct    ipstat {
  79.     long    ips_total;        /* total packets received */
  80.     long    ips_badsum;        /* checksum bad */
  81.     long    ips_tooshort;        /* packet too short */
  82.     long    ips_toosmall;        /* not enough data */
  83.     long    ips_badhlen;        /* ip header length < data size */
  84.     long    ips_badlen;        /* ip length < ip header length */
  85.     long    ips_fragments;        /* fragments received */
  86.     long    ips_fragdropped;    /* frags dropped (dups, out of space) */
  87.     long    ips_fragtimeout;    /* fragments timed out */
  88.     long    ips_forward;        /* packets forwarded */
  89.     long    ips_cantforward;    /* packets rcvd for unreachable dest */
  90.     long    ips_redirectsent;    /* packets forwarded on same net */
  91.     long    ips_noproto;        /* unknown or unsupported protocol */
  92.     long    ips_delivered;        /* packets consumed here */
  93.     long    ips_localout;        /* total ip packets generated here */
  94.     long    ips_odropped;        /* lost packets due to nobufs, etc. */
  95.     long    ips_reassembled;    /* total packets reassembled ok */
  96.     long    ips_fragmented;        /* output packets fragmented ok */
  97.     long    ips_ofragments;        /* output fragments created */
  98.     long    ips_cantfrag;        /* don't fragment flag was set, etc. */
  99. };
  100.  
  101. #endif /* !NETINET_IP_VAR_H */
  102.